&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI adm2
&ANALYZE-RESUME
&Scoped-define WINDOW-NAME CURRENT-WINDOW


/* Temp-Table and Buffer definitions                                    */
DEFINE TEMP-TABLE ab_unmap
       FIELD adr1f AS CHARACTER FORMAT "X(256)":U 
       FIELD adr2f AS CHARACTER FORMAT "X(256)":U 
       FIELD adr3f AS CHARACTER FORMAT "X(256)":U 
       FIELD alang AS CHARACTER FORMAT "X(256)":U 
       FIELD civilfx AS CHARACTER 
       FIELD erreur AS CHARACTER FORMAT "X(256)":U 
       FIELD err_adr AS CHARACTER FORMAT "X(256)":U 
       FIELD err_pwd AS CHARACTER FORMAT "X(256)":U 
       FIELD FRowid AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-ma AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-me AS CHARACTER FORMAT "X(256)":U 
       FIELD lab-mo AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_adresse AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_local AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_mail AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_mobli AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_natel AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_news AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_nom AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_pays AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_prenom AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_tel AS CHARACTER FORMAT "X(256)":U 
       FIELD localf AS CHARACTER FORMAT "X(256)":U 
       FIELD LRowid AS CHARACTER FORMAT "X(256)":U 
       FIELD mailf AS CHARACTER FORMAT "X(256)":U 
       FIELD natelf AS CHARACTER FORMAT "X(256)":U 
       FIELD navigation AS CHARACTER FORMAT "X(256)":U 
       FIELD news AS LOGICAL  INITIAL no
       FIELD nomfx AS CHARACTER FORMAT "X(256)":U 
       FIELD nomfxx AS CHARACTER FORMAT "X(256)":U 
       FIELD nopostf AS CHARACTER FORMAT "X(256)":U 
       FIELD par-prog AS CHARACTER FORMAT "X(256)":U 
       FIELD paysf AS CHARACTER 
       FIELD prog_suivant AS CHARACTER FORMAT "X(256)":U 
       FIELD telf AS CHARACTER FORMAT "X(256)":U 
       FIELD texte1 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte2 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte3 AS CHARACTER FORMAT "X(256)":U .



&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS w-html 
/*------------------------------------------------------------------------

  File: 

  Description: 

  Input Parameters:
      <none>

  Output Parameters:
      <none>

  Author: 

  Created: 

------------------------------------------------------------------------*/
/*           This .W file was created with AppBuilder.                  */
/*----------------------------------------------------------------------*/

/* Create an unnamed pool to store all the widgets created 
     by this procedure. This is a good default which assures
     that this procedure's triggers and internal procedures 
     will execute in this procedure's storage, and that proper
     cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.

/* ***************************  Definitions  ************************** */

/* Preprocessor Definitions ---                                         */

/* Parameters Definitions ---                                           */

/* Local Variable Definitions ---                                       */

DEF TEMP-TABLE TT-abo   NO-UNDO
    FIELD nohist AS INTEGER
    FIELD libel  AS CHARACTER
    FIELD noadrb AS INTEGER
    FIELD csmtb  AS INTEGER
    FIELD nb     AS INTEGER
    FIELD recu   AS CHARACTER
    FIELD ech    AS CHARACTER
    FIELD id     AS CHARACTER
    FIELD idr    AS RECID
    INDEX key1 noadrb csmtb nohist
    INDEX key2 id.


DEF VAR wcoul-colp      AS CHARACTER                 NO-UNDO.
DEF VAR wcoul-coli      AS CHARACTER                 NO-UNDO.

DEF VAR tab-lib         AS CHARACTER EXTENT 10       NO-UNDO.
DEF VAR lib-rec         AS CHARACTER                 NO-UNDO.
DEF VAR lib-type        AS CHARACTER                 NO-UNDO.
DEF VAR lib-lang        AS CHARACTER                 NO-UNDO.
DEF VAR lib-stat        AS CHARACTER                 NO-UNDO.

DEF VAR i               AS INTEGER                   NO-UNDO.
DEF VAR j               AS INTEGER                   NO-UNDO.
DEF VAR nb-record       AS INTEGER                   NO-UNDO.


DEF VAR f-labind        AS CHARACTER                 NO-UNDO.
DEF VAR f-labindf       AS CHARACTER                 NO-UNDO.
DEF VAR f-labinda       AS CHARACTER                 NO-UNDO.

DEF VAR f-labtous       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtousf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtousa      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtcah       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtcahf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtcaha      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtmar       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtmarf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtmara      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtact       AS CHARACTER                 NO-UNDO.
DEF VAR f-labtactf      AS CHARACTER                 NO-UNDO.
DEF VAR f-labtacta      AS CHARACTER                 NO-UNDO.
DEF VAR action          AS CHARACTER                 NO-UNDO.

DEF VAR flag-aff        AS LOGICAL                   NO-UNDO.
DEF VAR flag-libraire   AS LOGICAL                   NO-UNDO.
DEF VAR flag-tous       AS LOGICAL                   NO-UNDO.
DEF VAR lst-hors        AS CHARACTER                 NO-UNDO.

DEF VAR lab-rec         AS CHARACTER  INIT "Lib rec" NO-UNDO.
DEF VAR a-lang          AS INTEGER                   NO-UNDO.
DEF VAR lab-bouton      AS CHARACTER EXTENT 5        NO-UNDO.

DEF VAR flag-int        AS LOGICAL                   NO-UNDO.
DEF VAR flag-ou         AS LOGICAL                   NO-UNDO.
DEF VAR flag-select     AS LOGICAL                   NO-UNDO.

DEF VAR buf-nocli       AS INTEGER                   NO-UNDO.
DEF VAR buf-csmt        AS INTEGER                   NO-UNDO.

DEF VAR buf-prefix      LIKE doce.prefix             NO-UNDO.
DEF VAR buf-nodoc       LIKE doce.nodoc              NO-UNDO.

DEF VAR buf-nbart       AS INTEGER                   NO-UNDO.
DEF VAR buf-nosoc       AS INTEGER  INIT 1           NO-UNDO.

DEF VAR buf-psuivant    AS CHARACTER                 NO-UNDO.
DEF VAR buf-mont        AS DECIMAL                   NO-UNDO.
DEF VAR buf-mon         AS CHARACTER INIT "EUR"      NO-UNDO.

DEF NEW SHARED VAR buf-codmon           LIKE apri.codmon                     NO-UNDO.
DEF NEW SHARED VAR buf-datdoc           LIKE atar.datfin                     NO-UNDO.
DEF NEW SHARED VAR buf-typr             LIKE atar.typr                       NO-UNDO.
DEF NEW SHARED VAR buf-tiersl           LIKE atar.tiers                      NO-UNDO.
DEF NEW SHARED VAR buf-tiersf           LIKE atar.tiers                      NO-UNDO.
DEF NEW SHARED VAR buf-noadrl           LIKE atar.noadr                      NO-UNDO.
DEF NEW SHARED VAR buf-csmtl            LIKE atar.csmt                       NO-UNDO.
DEF NEW SHARED VAR buf-noadrf           LIKE atar.noadr                      NO-UNDO.
DEF NEW SHARED VAR buf-csmtf            LIKE atar.csmt                       NO-UNDO.
DEF NEW SHARED VAR buf-type             LIKE atar.type                       NO-UNDO.
DEF NEW SHARED VAR buf-umb              LIKE arti.unit                       NO-UNDO.
DEF NEW SHARED VAR buf-umq              LIKE arti.unit                       NO-UNDO.
DEF NEW SHARED VAR buf-pcent            LIKE atar.pcent                      NO-UNDO.
DEF NEW SHARED VAR buf-pumb             AS   DECIMAL                         NO-UNDO.
DEF NEW SHARED VAR buf-pump             LIKE apri.prix                       NO-UNDO.
DEF NEW SHARED VAR buf-ump              LIKE apri.unit                       NO-UNDO.
DEF NEW SHARED VAR buf-nocpt            LIKE apri.nocpt                      NO-UNDO.
DEF NEW SHARED VAR buf-taxe             LIKE apri.taxe                       NO-UNDO.
DEF NEW SHARED VAR buf-qumb             LIKE atar.qte                        NO-UNDO.
DEF NEW SHARED VAR buf-qumq             LIKE atar.qte                        NO-UNDO.
DEF NEW SHARED VAR buf-rabchf           LIKE atar.rabaischf                  NO-UNDO.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK 

/* ********************  Preprocessor Definitions  ******************** */

&Scoped-define PROCEDURE-TYPE Web-Object
&Scoped-define DB-AWARE no

&Scoped-define WEB-FILE livraison.htm

/* Name of designated FRAME-NAME and/or first browse and/or first query */
&Scoped-define FRAME-NAME Web-Frame

/* Standard List Definitions                                            */
&Scoped-Define ENABLED-OBJECTS ab_unmap.civilfx ab_unmap.err_pwd ~
ab_unmap.lab-ma ab_unmap.lab-me ab_unmap.lab-mo ab_unmap.lab_prenom ~
ab_unmap.nomfxx ab_unmap.prog_suivant ab_unmap.nopostf ab_unmap.err_adr ~
ab_unmap.lab_mobli ab_unmap.natelf ab_unmap.telf ab_unmap.paysf ~
ab_unmap.lab_news ab_unmap.news ab_unmap.lab_natel ab_unmap.lab_tel ~
ab_unmap.par-prog ab_unmap.lab_mail ab_unmap.mailf ab_unmap.adr1f ~
ab_unmap.adr2f ab_unmap.adr3f ab_unmap.lab_adresse ab_unmap.lab_local ~
ab_unmap.lab_nom ab_unmap.lab_pays ab_unmap.localf ab_unmap.nomfx ~
ab_unmap.erreur ab_unmap.texte1 ab_unmap.texte2 ab_unmap.texte3 ~
ab_unmap.alang ab_unmap.FRowid ab_unmap.LRowid ab_unmap.navigation 
&Scoped-Define DISPLAYED-OBJECTS ab_unmap.civilfx ab_unmap.err_pwd ~
ab_unmap.lab-ma ab_unmap.lab-me ab_unmap.lab-mo ab_unmap.lab_prenom ~
ab_unmap.nomfxx ab_unmap.prog_suivant ab_unmap.nopostf ab_unmap.err_adr ~
ab_unmap.lab_mobli ab_unmap.natelf ab_unmap.telf ab_unmap.paysf ~
ab_unmap.lab_news ab_unmap.news ab_unmap.lab_natel ab_unmap.lab_tel ~
ab_unmap.par-prog ab_unmap.lab_mail ab_unmap.mailf ab_unmap.adr1f ~
ab_unmap.adr2f ab_unmap.adr3f ab_unmap.lab_adresse ab_unmap.lab_local ~
ab_unmap.lab_nom ab_unmap.lab_pays ab_unmap.localf ab_unmap.nomfx ~
ab_unmap.erreur ab_unmap.texte1 ab_unmap.texte2 ab_unmap.texte3 ~
ab_unmap.alang ab_unmap.FRowid ab_unmap.LRowid ab_unmap.navigation 

/* Custom List Definitions                                              */
/* List-1,List-2,List-3,List-4,List-5,List-6                            */

/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME



/* ***********************  Control Definitions  ********************** */


/* Definitions of the field level widgets                               */

/* ************************  Frame Definitions  *********************** */

DEFINE FRAME Web-Frame
     ab_unmap.civilfx AT ROW 1 COL 1 HELP
          "" NO-LABEL
          VIEW-AS RADIO-SET VERTICAL
          RADIO-BUTTONS 
                    "civilfx 1", "civilfx 1":U,
"civilfx 2", "civilfx 2":U,
"civilfx 3", "civilfx 3":U
          SIZE 20 BY 4
     ab_unmap.err_pwd AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-ma AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-me AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab-mo AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_prenom AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.nomfxx AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.prog_suivant AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.nopostf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.err_adr AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_mobli AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.natelf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.telf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.paysf AT ROW 1 COL 1 HELP
          "" NO-LABEL
          VIEW-AS SELECTION-LIST SINGLE NO-DRAG SORT 
          LIST-ITEM-PAIRS "code","libel" 
          SIZE 20 BY 4
     ab_unmap.lab_news AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.news AT ROW 1 COL 1 HELP
          ""
          LABEL "news"
          VIEW-AS TOGGLE-BOX
          SIZE 20 BY 1
     ab_unmap.lab_natel AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_tel AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.par-prog AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_mail AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.mailf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr1f AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr2f AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 60.38 BY 14.13.

/* DEFINE FRAME statement is approaching 4K Bytes.  Breaking it up   */
DEFINE FRAME Web-Frame
     ab_unmap.adr3f AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_adresse AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_local AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_nom AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_pays AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.localf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.nomfx AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.erreur AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte1 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte2 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte3 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.alang AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.FRowid AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.LRowid AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.navigation AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 60.38 BY 14.13.


/* *********************** Procedure Settings ************************ */

&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
   Type: Web-Object
   Allow: Query
   Frames: 1
   Add Fields to: Neither
   Editing: Special-Events-Only
   Events: web.output,web.input
   Other Settings: COMPILE
   Temp-Tables and Buffers:
      TABLE: ab_unmap W "?" ?  
      ADDITIONAL-FIELDS:
          FIELD adr1f AS CHARACTER FORMAT "X(256)":U 
          FIELD adr2f AS CHARACTER FORMAT "X(256)":U 
          FIELD adr3f AS CHARACTER FORMAT "X(256)":U 
          FIELD alang AS CHARACTER FORMAT "X(256)":U 
          FIELD civilfx AS CHARACTER 
          FIELD erreur AS CHARACTER FORMAT "X(256)":U 
          FIELD err_adr AS CHARACTER FORMAT "X(256)":U 
          FIELD err_pwd AS CHARACTER FORMAT "X(256)":U 
          FIELD FRowid AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-ma AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-me AS CHARACTER FORMAT "X(256)":U 
          FIELD lab-mo AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_adresse AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_local AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_mail AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_mobli AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_natel AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_news AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_nom AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_pays AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_prenom AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_tel AS CHARACTER FORMAT "X(256)":U 
          FIELD localf AS CHARACTER FORMAT "X(256)":U 
          FIELD LRowid AS CHARACTER FORMAT "X(256)":U 
          FIELD mailf AS CHARACTER FORMAT "X(256)":U 
          FIELD natelf AS CHARACTER FORMAT "X(256)":U 
          FIELD navigation AS CHARACTER FORMAT "X(256)":U 
          FIELD news AS LOGICAL  INITIAL no
          FIELD nomfx AS CHARACTER FORMAT "X(256)":U 
          FIELD nomfxx AS CHARACTER FORMAT "X(256)":U 
          FIELD nopostf AS CHARACTER FORMAT "X(256)":U 
          FIELD par-prog AS CHARACTER FORMAT "X(256)":U 
          FIELD paysf AS CHARACTER 
          FIELD prog_suivant AS CHARACTER FORMAT "X(256)":U 
          FIELD telf AS CHARACTER FORMAT "X(256)":U 
          FIELD texte1 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte2 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte3 AS CHARACTER FORMAT "X(256)":U 
      END-FIELDS.
   END-TABLES.
 */
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS

/* *************************  Create Window  ************************** */

&ANALYZE-SUSPEND _CREATE-WINDOW
/* DESIGN Window definition (used by the UIB) 
  CREATE WINDOW w-html ASSIGN
         HEIGHT             = 14.13
         WIDTH              = 60.38.
/* END WINDOW DEFINITION */
                                                                        */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB w-html 
/* *********************** Included-Libraries ************************* */

{src/web2/html-map.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME




/* ***********  Runtime Attributes and AppBuilder Settings  *********** */

&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
/* SETTINGS FOR WINDOW w-html
  VISIBLE,,RUN-PERSISTENT                                               */
/* SETTINGS FOR FRAME Web-Frame
   FRAME-NAME UNDERLINE                                                 */
/* SETTINGS FOR FILL-IN ab_unmap.adr1f IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr2f IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr3f IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.alang IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR RADIO-SET ab_unmap.civilfx IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.erreur IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.err_adr IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.err_pwd IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.FRowid IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-ma IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-me IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab-mo IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_adresse IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_local IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_mail IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_mobli IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_natel IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_news IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_nom IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_pays IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_prenom IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_tel IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.localf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.LRowid IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.mailf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.natelf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.navigation IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR TOGGLE-BOX ab_unmap.news IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.nomfx IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.nomfxx IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.nopostf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.par-prog IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR SELECTION-LIST ab_unmap.paysf IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.prog_suivant IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.telf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte1 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte2 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte3 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* _RUN-TIME-ATTRIBUTES-END */
&ANALYZE-RESUME

 



/* ************************  Control Triggers  ************************ */

&Scoped-define SELF-NAME ab_unmap.erreur
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.erreur w-html WEB.output
PROCEDURE ab_unmap.erreur.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     IF REQUEST_METHOD = "POST":U AND NOT flag-select THEN DO:
         {&out} "toto".
        RUN affiche_texte(101151,"abo_select_erreur.htm").
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.err_adr
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.err_adr w-html web.output
PROCEDURE ab_unmap.err_adr.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101044).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-ma
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-ma w-html WEB.output
PROCEDURE ab_unmap.lab-ma.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      FIND erreur WHERE erreur.noerr = 500586
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      IF AVAILABLE erreur AND erreur.libel <> "" THEN {&out} ENTRY(2,TRIM(SUBSTRING(erreur.libel,1,63))).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-me
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-me w-html WEB.output
PROCEDURE ab_unmap.lab-me.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      FIND erreur WHERE erreur.noerr = 500586
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      IF AVAILABLE erreur AND erreur.libel <> "" THEN {&out} ENTRY(1,TRIM(SUBSTRING(erreur.libel,1,63))).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab-mo
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab-mo w-html WEB.output
PROCEDURE ab_unmap.lab-mo.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      FIND erreur WHERE erreur.noerr = 500586
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      IF AVAILABLE erreur AND erreur.libel <> "" THEN {&out} ENTRY(3,TRIM(SUBSTRING(erreur.libel,1,63))).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_adresse
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_adresse w-html web.output
PROCEDURE ab_unmap.lab_adresse.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101117).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_local
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_local w-html web.output
PROCEDURE ab_unmap.lab_local.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101118).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_mail
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_mail w-html WEB.output
PROCEDURE ab_unmap.lab_mail.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101104).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_mobli
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_mobli w-html WEB.output
PROCEDURE ab_unmap.lab_mobli.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101120).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_natel
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_natel w-html web.output
PROCEDURE ab_unmap.lab_natel.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101156).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_news
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_news w-html web.output
PROCEDURE ab_unmap.lab_news.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101089).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_nom
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_nom w-html web.output
PROCEDURE ab_unmap.lab_nom.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101116).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_pays
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_pays w-html web.output
PROCEDURE ab_unmap.lab_pays.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101119).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_prenom
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_prenom w-html WEB.output
PROCEDURE ab_unmap.lab_prenom.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN aff_label(101175).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_tel
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_tel w-html web.output
PROCEDURE ab_unmap.lab_tel.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN aff_label(100027).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.navigation
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.navigation w-html WEB.output
PROCEDURE ab_unmap.navigation.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  RUN navigue.p (101168,a-lang).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.prog_suivant
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.prog_suivant w-html WEB.output
PROCEDURE ab_unmap.prog_suivant.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     IF REQUEST_METHOD = "POST":U THEN DO:
        {&out} "" SKIP
               "".
        {&out} buf-psuivant.
        {&out} "" SKIP "" SKIP.
     END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte1
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte1 w-html WEB.output
PROCEDURE ab_unmap.texte1.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN affiche_texte(101164,"livraison_texte1.htm").
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte2
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte2 w-html WEB.output
PROCEDURE ab_unmap.texte2.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN affiche_texte(101165,"livraison_texte2.htm").
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte3
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte3 w-html WEB.output
PROCEDURE ab_unmap.texte3.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN affiche_texte(101166,"livraison_texte3.htm").
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&UNDEFINE SELF-NAME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK w-html 


/* ************************  Main Code Block  ************************* */

/* Standard Main Block that runs adm-create-objects, initializeObject 
 * and process-web-request.
 * The bulk of the web processing is in the Procedure process-web-request
 * elsewhere in this Web object.
 */
{src/web2/template/hmapmain.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


/* **********************  Internal Procedures  *********************** */

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects w-html  _ADM-CREATE-OBJECTS
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
  Purpose:     Create handles for all SmartObjects used in this procedure.
               After SmartObjects are initialized, then SmartLinks are added.
  Parameters:  <none>
------------------------------------------------------------------------------*/

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE affiche_texte w-html 
PROCEDURE affiche_texte :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

  DEF INPUT PARAMETER par-noerr      AS     INTEGER.
  DEF INPUT PARAMETER par-nompage    AS     CHARACTER.


  DEF VAR nom_page        AS CHARACTER      NO-UNDO.
  DEF VAR ligne           AS CHARACTER      NO-UNDO.
  DEF VAR lst-tag         AS CHARACTER      NO-UNDO.
  DEF VAR pos             AS INTEGER        NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:
     FIND erreur WHERE erreur.noerr = par-noerr
                   AND erreur.lang  = a-lang NO-LOCK NO-ERROR.

     nom_page = SEARCH(par-nompage).
     IF nom_page = ? THEN RETURN.
     INPUT FROM VALUE(nom_page).
     REPEAT:
        IMPORT UNFORMATTED ligne.
        pos = INDEX(ligne,"<!--WSTAG").
        IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
        IF pos = 0 THEN {&out} ligne SKIP.
        ELSE DO:
           RUN decode_tag(ligne,"texte",OUTPUT lst-tag).
           DO i = 1 TO NUM-ENTRIES(lst-tag).
              RUN remplace_tag ("texte",1,ENTRY(i,lst-tag),erreur.libel,INPUT-OUTPUT ligne).
           END.
           {&out} ligne SKIP.
        END.
     END.

  END.
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE aff_label w-html 
PROCEDURE aff_label :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

  DEF INPUT PARAMETER num  AS INTEGER NO-UNDO.
  FIND erreur WHERE erreur.noerr = num
                AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
  IF AVAILABLE erreur AND erreur.libel <> "" THEN {&out} TRIM(erreur.libel).
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE creation_ident w-html 
PROCEDURE creation_ident :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

 DEF INPUT PARAMETER buf-nocli  AS     INTEGER      NO-UNDO.

 DEF VAR i AS INT NO-UNDO.
 DEF VAR j AS INT NO-UNDO.
 DEF VAR buf-code AS CHAR.


 DO WHILE TRUE:
    buf-code = "".
    REPEAT i = 1 TO 8:
        j = RANDOM(32,126).
        buf-code = buf-code + CHR(j).
    END.
    buf-code = ENCODE(buf-code).
    FIND FIRST hist WHERE hist.nosoc = 1
                      AND hist.prov  = "IDENTWEB"
                      AND hist.clef  = buf-code NO-LOCK NO-ERROR.

    IF NOT AVAILABLE hist THEN DO:
       CREATE hist.
       ASSIGN hist.nosoc  = buf-nosoc
              hist.prov   = "IDENTWEB"
              hist.clef   = buf-code
              hist.nohist = buf-nocli * 10.
       LEAVE.
    END.
 END.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE decode_tag w-html 
PROCEDURE decode_tag :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF INPUT  PARAMETER ligne    AS CHARACTER           NO-UNDO.
DEF INPUT  PARAMETER ancre    AS CHARACTER           NO-UNDO.
DEF OUTPUT PARAMETER lst-tag  AS CHARACTER           NO-UNDO.

DEF VAR i              AS INTEGER           NO-UNDO.
DEF VAR j              AS INTEGER           NO-UNDO.
DEF VAR pos            AS INTEGER           NO-UNDO.
DEF VAR tag            AS CHARACTER         NO-UNDO.


  REPEAT:
     i = INDEX(ligne,"<!--").
     j = IF INDEX(ligne,"-->") <> 0 THEN INDEX(ligne,"-->") + 2 ELSE LENGTH(ligne).
     IF i = 0 THEN LEAVE.
     tag = SUBSTRING(ligne,i,j - i + 1).
     pos = INDEX(tag,"<!--WSTAG").
     IF pos <> 0 THEN DO:
        pos = INDEX(tag,ancre).
        IF pos <> 0 AND LOOKUP(tag,lst-tag) = 0 THEN lst-tag = lst-tag + "," + tag.
     END.
     ligne = SUBSTRING(ligne,j + 1).
  END.
  lst-tag = SUBSTRING(lst-tag,2).
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE htmOffsets w-html  _WEB-HTM-OFFSETS
PROCEDURE htmOffsets :
/*------------------------------------------------------------------------------
  Purpose:     Runs procedure to associate each HTML field with its
               corresponding widget name and handle.
  Parameters:  
  Notes:       
------------------------------------------------------------------------------*/
  RUN readOffsets ("{&WEB-FILE}":U).
  RUN htmAssociate
    ("adr1f":U,"ab_unmap.adr1f":U,ab_unmap.adr1f:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr2f":U,"ab_unmap.adr2f":U,ab_unmap.adr2f:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr3f":U,"ab_unmap.adr3f":U,ab_unmap.adr3f:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("civilfx":U,"ab_unmap.civilfx":U,ab_unmap.civilfx:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("erreur":U,"ab_unmap.erreur":U,ab_unmap.erreur:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("err_adr":U,"ab_unmap.err_adr":U,ab_unmap.err_adr:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("err_pwd":U,"ab_unmap.err_pwd":U,ab_unmap.err_pwd:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("FRowid":U,"ab_unmap.FRowid":U,ab_unmap.FRowid:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-ma":U,"ab_unmap.lab-ma":U,ab_unmap.lab-ma:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-me":U,"ab_unmap.lab-me":U,ab_unmap.lab-me:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab-mo":U,"ab_unmap.lab-mo":U,ab_unmap.lab-mo:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_adresse":U,"ab_unmap.lab_adresse":U,ab_unmap.lab_adresse:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_local":U,"ab_unmap.lab_local":U,ab_unmap.lab_local:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_mail":U,"ab_unmap.lab_mail":U,ab_unmap.lab_mail:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_mobli":U,"ab_unmap.lab_mobli":U,ab_unmap.lab_mobli:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_natel":U,"ab_unmap.lab_natel":U,ab_unmap.lab_natel:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_news":U,"ab_unmap.lab_news":U,ab_unmap.lab_news:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_nom":U,"ab_unmap.lab_nom":U,ab_unmap.lab_nom:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_pays":U,"ab_unmap.lab_pays":U,ab_unmap.lab_pays:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_prenom":U,"ab_unmap.lab_prenom":U,ab_unmap.lab_prenom:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_tel":U,"ab_unmap.lab_tel":U,ab_unmap.lab_tel:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lang":U,"ab_unmap.alang":U,ab_unmap.alang:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("localf":U,"ab_unmap.localf":U,ab_unmap.localf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("LRowid":U,"ab_unmap.LRowid":U,ab_unmap.LRowid:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("mailf":U,"ab_unmap.mailf":U,ab_unmap.mailf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("natelf":U,"ab_unmap.natelf":U,ab_unmap.natelf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("navigation":U,"ab_unmap.navigation":U,ab_unmap.navigation:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("news":U,"ab_unmap.news":U,ab_unmap.news:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("nomfx":U,"ab_unmap.nomfx":U,ab_unmap.nomfx:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("nomfxx":U,"ab_unmap.nomfxx":U,ab_unmap.nomfxx:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("nopostf":U,"ab_unmap.nopostf":U,ab_unmap.nopostf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("par-prog":U,"ab_unmap.par-prog":U,ab_unmap.par-prog:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("paysf":U,"ab_unmap.paysf":U,ab_unmap.paysf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("prog_suivant":U,"ab_unmap.prog_suivant":U,ab_unmap.prog_suivant:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("telf":U,"ab_unmap.telf":U,ab_unmap.telf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte1":U,"ab_unmap.texte1":U,ab_unmap.texte1:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte2":U,"ab_unmap.texte2":U,ab_unmap.texte2:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte3":U,"ab_unmap.texte3":U,ab_unmap.texte3:HANDLE IN FRAME {&FRAME-NAME}).
END PROCEDURE.


/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initialisation w-html 
PROCEDURE initialisation :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/
   DEF VAR flag-marq        AS      LOGICAL     NO-UNDO.
   DEF VAR lst-pays         AS      LOGICAL     NO-UNDO.


   a-lang = INTEGER(get-field("lang")).
   
   IF a-lang = 0 THEN a-lang = 2.

   DO WITH FRAME {&FRAME-NAME}:
      
       paysf:DELIMITER = "#".
       paysf:DELETE(1).
       paysf:ADD-LAST("","").
       FOR EACH hist WHERE hist.nosoc  = 0
                       AND hist.prov   = "PAYS"
                       AND hist.nohist = a-lang NO-LOCK:
           paysf:ADD-LAST(TRIM(hist.libel),TRIM(hist.clef)).
       END.

   END.

/*    RUN get-couleur.p ("01",ENTRY(1,get-cookie("CliId")),OUTPUT wcoul-coli).  */
/*    RUN get-couleur.p ("02",ENTRY(1,get-cookie("CliId")),OUTPUT wcoul-colp).  */

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE maj_adresse w-html 
PROCEDURE maj_adresse :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF BUFFER adrd-0   FOR adrd.

DO TRANSACTION:
   FIND adra WHERE adra.nosoc = buf-nosoc
               AND adra.noadr = buf-nocli
               AND adra.csmt  = 0 NO-ERROR.

   adra.civil    = get-field("civilf").
   adra.nom      = get-field("nomfx").
   adra.adr1     = get-field("adr1f").
   adra.adr2     = get-field("adr2f").
   adra.adr3     = get-field("adr3f").
   adra.ville    = get-field("localf").
   adra.nopo     = get-field("nopostf").
   adra.local    = adra.nopo + " " + adra.ville.
   adra.mail     = get-field("mailf").
   adra.tel      = get-field("telf").
   adra.portable = get-field("natelf").
   adra.news     = get-field("news") = "ON".

   FIND erreur WHERE erreur.noerr = 500586
                 AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
   CASE adra.civil:
       WHEN "Me" THEN adra.civil = ENTRY(1,TRIM(SUBSTRING(erreur.libel,1,63))).
       WHEN "Ma" THEN adra.civil = ENTRY(2,TRIM(SUBSTRING(erreur.libel,1,63))).
       WHEN "Mo" THEN adra.civil = ENTRY(3,TRIM(SUBSTRING(erreur.libel,1,63))).
   END CASE.

   FIND FIRST pays WHERE pays.post = get-field("paysf") NO-LOCK NO-ERROR.
      
   adra.codpays = pays.pays.

   FIND adrd-0 WHERE adrd-0.nosoc = 0
                 AND adrd-0.noadr = buf-nosoc
                 AND adrd-0.csmt  = 0 NO-LOCK NO-ERROR.
   FIND adrd WHERE adrd.nosoc = adra.nosoc
               AND adrd.noadr = adra.noadr
               AND adrd.csmt  = adra.csmt NO-ERROR.
   IF NOT AVAILABLE adrd THEN DO:
      CREATE adrd.
      ASSIGN adrd.nosoc = adra.nosoc
             adrd.noadr = adra.noadr
             adrd.csmt  = adra.csmt.
   END.

   ASSIGN adrd.codmon  = pays.monfact
          adrd.nbfac   = adrd-0.nbfac
          adrd.bvrm    = adrd-0.bvrm
          adrd.bvre    = adrd-0.bvre
          adrd.bvrbq   = adrd-0.bvrbq
          adrd.codicha = adrd-0.codicha
          adrd.esc     = adrd-0.esc
          adrd.echesc  = adrd-0.echesc
          adrd.echnet  = adrd-0.echnet
          adrd.echle   = adrd-0.echle
          adrd.typc    = adrd-0.typc
          adrd.limcre  = adrd-0.limcre
          adrd.rappel  = adrd-0.rappel
          adrd.docbloq = adrd-0.docbloq
          adrd.typrap  = adrd-0.typrap
          adrd.cptcol  = adrd-0.cptcol
          adrd.perfac  = adrd-0.perfac
          adrd.codfac  = adrd-0.codfac.

   FIND FIRST gexe WHERE gexe.nosoc  = buf-nosoc
                     AND gexe.finex >= TODAY
                     AND gexe.debex <= TODAY  NO-LOCK NO-ERROR.

   FIND FIRST gcpt WHERE gcpt.nosoc = buf-nosoc
                     AND gcpt.exer  = gexe.exer                       
                     AND gcpt.boucl = ""
                     AND gcpt.nocpt >= "10501"
                     AND gcpt.nocpt <= "10519"
                     AND gcpt.codmon = adrd.codmon NO-LOCK NO-ERROR.

   IF AVAILABLE gcpt THEN adrd.cptcol = gcpt.nocpt.
   ELSE adrd.codmon = "CHF".
END.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE outputHeader w-html 
PROCEDURE outputHeader :
/*------------------------------------------------------------------------
  Purpose:     Output the MIME header, and any "cookie" information needed 
               by this procedure.  
  Parameters:  <none>
  Notes:       In the event that this Web object is state-aware, this is 
               a good place to set the WebState and WebTimeout attributes.
------------------------------------------------------------------------*/
  /* To make this a state-aware Web object, pass in the timeout period
   * (in minutes) before running outputContentType.  If you supply a 
   * timeout period greater than 0, the Web object becomes state-aware 
   * and the following happens:
   *
   *   - 4GL variables webState and webTimeout are set
   *   - a cookie is created for the broker to id the client on the return trip
   *   - a cookie is created to id the correct procedure on the return trip
   *
   * If you supply a timeout period less than 1, the following happens:
   *
   *   - 4GL variables webState and webTimeout are set to an empty string
   *   - a cookie is killed for the broker to id the client on the return trip
   *   - a cookie is killed to id the correct procedure on the return trip
   *
   * For example, set the timeout period to 5 minutes.
   *
   *   setWebState (5.0).
   */
    
  /* Output additional cookie information here before running outputContentType.
   *   For more information about the Netscape Cookie Specification, see
   *   http://home.netscape.com/newsref/std/cookie_spec.html  
   *   
   *   Name         - name of the cookie
   *   Value        - value of the cookie
   *   Expires date - Date to expire (optional). See TODAY function.
   *   Expires time - Time to expire (optional). See TIME function.
   *   Path         - Override default URL path (optional)
   *   Domain       - Override default domain (optional)
   *   Secure       - "secure" or unknown (optional)
   * 
   *   The following example sets custNum=23 and expires tomorrow at (about)
   *   the same time but only for secure (https) connections.
   *      
   *   RUN SetCookie IN web-utilities-hdl 
   *     ("custNum":U, "23":U, TODAY + 1, TIME, ?, ?, "secure":U).
   */ 
  output-content-type ("text/html":U).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE process-web-request w-html 
PROCEDURE process-web-request :
/*------------------------------------------------------------------------
  Purpose:     Process the web request.
  Notes:       
------------------------------------------------------------------------*/
    
  /* STEP 0 -
   * Output the MIME header and set up the object as state-less or state-aware. 
   * This is required if any HTML is to be returned to the browser. 
   *
   * NOTE: Move 'RUN outputHeader.' to the GET section below if you are going
   * to simulate another Web request by running a Web Object from this
   * procedure.  Running outputHeader precludes setting any additional cookie
   * information.
   */ 
   
/*   RUN outputHeader.  */

  RUN initialisation.
       
/*   IF get-cookie("SessionId") <> "" THEN                             */
/*      ASSIGN buf-nocli  = INTEGER(ENTRY(1,get-cookie("SessionId")))  */
/*             buf-prefix = ENTRY(2,get-cookie("SessionId"))           */
/*             buf-nodoc  = INTEGER(ENTRY(3,get-cookie("SessionId"))). */
/*                                                                     */
  /* Describe whether to receive FORM input for all the fields.  For example,
   * check particular input fields (using GetField in web-utilities-hdl). 
   * Here we look at REQUEST_METHOD. 
   */
  IF REQUEST_METHOD = "POST":U THEN DO:
    /* STEP 1 -
     * Copy HTML input field values to the Progress form buffer. */
    RUN inputFields.
        /* STEP 2 -
     * Open the database or SDO query and and fetch the first record. */ 
    RUN findRecords.
    
    ab_unmap.par-prog = get-field("par-prog").

    /* STEP 3 -    
     * AssignFields will save the data in the frame.
     * (it automatically upgrades the lock to exclusive while doing the update)
     * 
     *  If a new record needs to be created set AddMode to true before 
        running assignFields.  
     *     setAddMode(TRUE).   
     * RUN assignFields. */
    
    /* STEP 4 -
     * Decide what HTML to return to the user. Choose STEP 4.1 to simulate
     * another Web request -OR- STEP 4.2 to return the original form (the
     * default action).
     *
     * STEP 4.1 -
     * To simulate another Web request, change the REQUEST_METHOD to GET
     * and RUN the Web object here.  For example,
     *
     *  ASSIGN REQUEST_METHOD = "GET":U.
     *  RUN run-web-object IN web-utilities-hdl ("myobject.w":U).
     */
     
    /* STEP 4.2 -
     * To return the form again, set data values, display them, and output 
     * them to the WEB stream.  
     *
     * STEP 4.2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.
   
    /* STEP 4.2b -
     * Enable objects that should be enabled. */
    RUN enableFields.
    
    action   = get-field("navigue").

    FIND erreur WHERE erreur.noerr = 101168
                  AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
    j = 1.
    DO i = 1 TO NUM-ENTRIES(erreur.libel):
       lab-bouton[j] = ENTRY(i,erreur.libel).
       j = j + 1.
    END.

    IF action <> lab-bouton[1] AND
       action <> lab-bouton[2] AND
       action <> lab-bouton[3] AND
       action <> lab-bouton[4] AND
       action <> lab-bouton[5] THEN action = lab-bouton[2].


    buf-psuivant = get-field("par-prog").

    IF action = lab-bouton[1] THEN DO:
       buf-nocli = INTEGER(get-cookie("Livraison")).
       RUN SetCookie IN web-utilities-hdl ("Livraison","",?,?,?,?,?).
       FIND adra WHERE adra.nosoc = buf-nosoc
                   AND adra.noadr = buf-nocli
                   AND adra.csmt  = 0 NO-ERROR.
       IF AVAILABLE adra THEN DELETE adra.
       FIND adrd WHERE adrd.nosoc = adra.nosoc
                   AND adrd.noadr = adra.noadr
                   AND adrd.csmt  = adra.csmt NO-ERROR.
       IF AVAILABLE adrd THEN DELETE adrd.
    END.

    IF action = lab-bouton[2] THEN DO:
       buf-nocli = INTEGER(get-cookie("Livraison")).
       RUN SetCookie IN web-utilities-hdl ("Livraison",STRING(buf-nocli),?,?,?,?,?).
       RUN maj_adresse.
    END.

    IF action = lab-bouton[1] OR
       action = lab-bouton[2] OR 
       action = lab-bouton[3] THEN 
          IF a-lang = 1 THEN  buf-psuivant = "abo_new_de|".
          ELSE buf-psuivant = "abo_new_fr|130|".           
/*         buf-psuivant = get-field("par-prog").  */

/*        ASSIGN REQUEST_METHOD = "GET":U.                             */
/*        RUN run-web-object IN web-utilities-hdl ("abo_ctrlog.p":U).  */
/*        RETURN.                                                      */
/*     END.                                                            */
/*                                                                     */
    RUN outputHeader.

    /* STEP 4.2c -
     * OUTPUT the Progress form buffer to the WEB stream. */
    RUN outputFields.
    
  END. /* Form has been submitted. */
 
  /* REQUEST-METHOD = GET */ 
  ELSE DO:
    /* This is the first time that the form has been called. Just return the
     * form.  Move 'RUN outputHeader.' here if you are going to simulate
     * another Web request. */ 

    IF get-cookie("Livraison") <> "" THEN DO:
       buf-nocli = INTEGER(get-cookie("Livraison")).
       FIND adra WHERE adra.nosoc = buf-nosoc
                   AND adra.noadr = buf-nocli
                   AND adra.csmt  = 0 NO-LOCK NO-ERROR.
       IF AVAILABLE adra THEN DO:
          ASSIGN ab_unmap.civilf  = adra.civil
                 ab_unmap.nomfx   = adra.nom
                 ab_unmap.adr1    = adra.adr1
                 ab_unmap.adr2    = adra.adr2
                 ab_unmap.adr3    = adra.adr3
                 ab_unmap.localf  = adra.ville
                 ab_unmap.nopostf = adra.nopo
                 ab_unmap.mailf   = adra.mail
                 ab_unmap.telf    = adra.tel
                 ab_unmap.natelf  = adra.portable
                 ab_unmap.news    = adra.news.
          FIND pays WHERE pays.pays = adra.codpays NO-LOCK NO-ERROR.
          IF AVAILABLE pays THEN ab_unmap.paysf = pays.post.
       END.
    END.
    ELSE DO:
       RUN recherche_nocli (OUTPUT buf-nocli).

       DO TRANSACTION:
          CREATE adra.
          ASSIGN adra.nosoc = 1
                 adra.noadr = buf-nocli.
          RUN creation_ident(buf-nocli).
       END.

       RUN SetCookie IN web-utilities-hdl ("Livraison",STRING(buf-nocli),?,?,?,?,?).
    END.

    RUN outputHeader.

    /* STEP 1 -
     * Open the database or SDO query and and fetch the first record. */ 
    RUN findRecords.
    
    ab_unmap.par-prog = get-field("par-prog").

    /* Return the form again. Set data values, display them, and output them
     * to the WEB stream.  
     *
     * STEP 2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.

    /* STEP 2b -
     * Enable objects that should be enabled. */
    RUN enableFields.

    /* STEP 2c -
     * OUTPUT the Progress from buffer to the WEB stream. */
    RUN outputFields.
  END. 
  
  /* Show error messages. */

  IF AnyMessage() THEN 
  DO:
     /* ShowDataMessage may return a Progress column name. This means you
      * can use the function as a parameter to HTMLSetFocus instead of 
      * calling it directly.  The first parameter is the form name.   
      *
      * HTMLSetFocus("document.DetailForm",ShowDataMessages()). */
     ShowDataMessages().
  END.
 
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE recherche_nocli w-html 
PROCEDURE recherche_nocli :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/
DEF OUTPUT PARAMETE p-noadr     AS       INTEGER       NO-UNDO.

DEF        VAR buf-nompar         AS CHAR                        NO-UNDO.
DEF        VAR buf-sup            AS INT  INIT 999999            NO-UNDO.
DEF        VAR buf-inf            AS INT                         NO-UNDO.
DEF        VAR buf-incr           AS INT  INIT 1                 NO-UNDO.
DEF        VAR buf-parmt          LIKE parmt.valpar          NO-UNDO.

ASSIGN p-noadr    = 0
       buf-nompar = "PLAGEADRWEB".

FIND parmt WHERE parmt.nomuti = ""
             AND parmt.nosoc  = 1 
             AND parmt.nompar = buf-nompar NO-LOCK NO-ERROR.
IF NOT AVAILABLE parmt THEN
   FIND parmt WHERE parmt.nomuti = ""
                AND parmt.nosoc  = 0
                AND parmt.nompar = buf-nompar NO-LOCK NO-ERROR.

IF AVAILABLE parmt THEN 
   ASSIGN buf-inf   = INTEGER(ENTRY(1,parmt.valpar))
          buf-sup   = INTEGER(ENTRY(2,parmt.valpar))
          buf-incr  = INTEGER(ENTRY(3,parmt.valpar)).

FIND adra WHERE adra.nosoc = 1
            AND adra.noadr = buf-sup
                AND adra.csmt  = 0 NO-LOCK NO-ERROR.
IF AVAILABLE adra THEN
   FIND LAST adra WHERE adra.nosoc = 1 NO-LOCK NO-ERROR.
ELSE FIND PREV adra WHERE adra.nosoc  = 1
                      AND adra.noadr >= buf-inf
                                  AND adra.csmt   = 0 NO-LOCK NO-ERROR.
p-noadr = IF AVAILABLE adra THEN adra.noadr + 1 ELSE buf-inf.
IF p-noadr MOD buf-incr <> 0 THEN
   p-noadr = TRUNCATE(p-noadr / buf-incr,0) * buf-incr + buf-incr.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE remplace_tag w-html 
PROCEDURE remplace_tag :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF INPUT        PARAMETER ancre    AS   CHARACTER        NO-UNDO.       
DEF INPUT        PARAMETER nombre   AS   INTEGER          NO-UNDO.       
DEF INPUT        PARAMETER tag      AS   CHARACTER        NO-UNDO.       
DEF INPUT        PARAMETER texte    AS   CHARACTER        NO-UNDO.       
DEF INPUT-OUTPUT PARAMETER ligne    AS   CHARACTER        NO-UNDO.

DEF VAR i          AS   INTEGER                    NO-UNDO.

DO i = 1 TO nombre:
   IF INDEX(tag,ancre + STRING(i,"99")) <> 0 THEN ligne = REPLACE(ligne,tag,ENTRY(i,texte,"#")).
END.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

